#define DEBUG
#include <cstdio>

using namespace std;

const int maxn=1000, maxm=1000, maxk=1000, mods=1000000007;

int main() {
  freopen("game.in", "r", stdin);
  freopen("game_bf.out", "w", stdout);

  static long long map[maxn+1][maxm+1];
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  for (int i=1; i<=n; i++) {
    for (int j=1; j<=m; j++) {
      map[i][j] = ((i-1)*m%mods+j)%mods;
    }
  }
  for (int i=1; i<=k; i++) {
    char c;
    int x, y;
    scanf(" %c %d %d", &c, &x, &y);
    if (c=='R') {
      for (int j=1; j<=m; j++) {
	map[x][j] = map[x][j]*y%mods;
      }
    } else {
      for (int j=1; j<=n; j++) {
	map[j][x] = map[j][x]*y%mods;
      }
    }
  }

  long long ans=0;
  for (int i=1; i<=n; i++) {
    for (int j=1; j<=m; j++) {
      ans = (ans+map[i][j])%mods;
    }
  }
  printf("%lld", ans);

  fclose(stdin);
  fclose(stdout);
  return 0;
}
